home *** CD-ROM | disk | FTP | other *** search
/ Creative Computers / Creative Computers CD-ROM, Volume 1 (Legendary Design Technologies, Inc.)(1994).iso / shareware / intuition / yak_1.57 / source / hotkey_types.h < prev    next >
C/C++ Source or Header  |  1994-11-17  |  3KB  |  118 lines

  1. /*
  2.  * Definitions for generic Yak hotkeys.
  3.  * mws, 27 April 1993
  4.  */
  5.  
  6. #ifndef HOTKEY_TYPES_H
  7. #define HOTKEY_TYPES_H
  8.  
  9. #ifndef EXEC_TYPES_H
  10. #include <exec/types.h>
  11. #endif /* EXEC_TYPES_H */
  12.  
  13. #ifndef EXEC_NODES_H
  14. #include <exec/nodes.h>
  15. #endif /* EXEC_NODES_H */
  16.  
  17. #ifndef EXEC_LISTS_H
  18. #include <exec/lists.h>
  19. #endif /* EXEC_LISTS_H */
  20.  
  21. #ifndef LIBRARIES_COMMODITIES_H
  22. #include <libraries/commodities.h>
  23. #endif /* LIBRARIES_COMMODITIES_H */
  24.  
  25.  
  26. /*
  27.  * YakHotKey structure definition
  28.  */
  29. typedef struct {
  30.     struct Node     yhk_Node;    /* node for linked-list */
  31.     CxObj        *yhk_CxObj;    /* cx object list */
  32.     char        *yhk_KeyDef;    /* actual key definition */
  33.     char        *yhk_ArgStr;    /* command argument */
  34.     UWORD         yhk_Type;    /* hotkey type */
  35.     UWORD         yhk_Options;    /* hotkey options */
  36. } YakHotKey;
  37.  
  38. /*
  39.  * Types of hotkey currently supported
  40.  */
  41. #define DOS_COMMAND            0
  42. #define CLOSE_WINDOW        1
  43. #define ZIP_WINDOW            2
  44. #define SHRINK_WINDOW        3
  45. #define EXPAND_WINDOW        4
  46. #define CYCLE_WINDOWS        5
  47. #define OPEN_PALETTE        6
  48. #define SCREEN_TO_FRONT        7
  49. #define SCREEN_TO_BACK        8
  50. #define ACTIVATE_WORKBENCH     9
  51. #define CENTRE_SCREEN        10
  52. #define BLANK_DISPLAY        11
  53. #define INSERT_TEXT            12
  54. #define INSERT_DATE            13
  55. #define SHOW_INTERFACE        14
  56. #define BACK_CYCLE_WINDOWS    15
  57. #define NUM_HOTKEY_TYPES     16
  58.  
  59. /*
  60.  * YakHotKey options.
  61.  */
  62. #define NO_OPTIONS            0
  63. #define WB_TO_FRONT            1
  64. #define DEF_PUBSCR_TO_FRONT 2
  65. #define NUM_OPTIONS         3
  66.  
  67. /*
  68.  * YakHotKeyType structure
  69.  */
  70. typedef struct {
  71.     struct    MinList yhkt_list;        /* list of keys */
  72.     void    (*yhkt_Command)(YakHotKey *);    /* command to call */
  73.     UWORD    yhkt_count;            /* # of keys attached */
  74.     WORD    yhkt_Flags;
  75. } YakHotKeyType;
  76.  
  77. /*
  78.  * Flags for YakHotKeyType
  79.  */
  80. #define    TAKES_ARGUMENT    (1<<0)        /* ArgStr is relevant */
  81. #define HAS_OPTIONS    (1<<1)        /* let user set screen behaviour */
  82.  
  83. /*
  84.  * Info for anyone to examine
  85.  */
  86. extern YakHotKeyType yhktypes[NUM_HOTKEY_TYPES];
  87. extern UWORD num_hkeys;
  88.  
  89. #define YHK_Takes_Arg(yhk)    (yhktypes[(yhk)->yhk_Type].yhkt_Flags & TAKES_ARGUMENT)
  90. #define YHK_Has_Options(yhk)    (yhktypes[(yhk)->yhk_Type].yhkt_Flags & HAS_OPTIONS)
  91. #define keylist(type)        ((struct List *)&yhktypes[type].yhkt_list)
  92. #define numkeys(type)        yhktypes[type].yhkt_count
  93.  
  94. /*
  95.  * And functions for anyone to call
  96.  */
  97. void PerformAction(YakHotKey *yhk);
  98. void DeleteYakHotKey(YakHotKey *yhk);
  99. int ModifyYHKKeyDef(YakHotKey *yhk, char *keystr);
  100. int ModifyYHKArgStr(YakHotKey *yhk, char *argstr);
  101. YakHotKey *NewYakHotKey(UWORD type);
  102. void InitYakHotKeyList(void);
  103. void DeleteYakHotKeyList(void);
  104. int OkayToExit(void);
  105. char *DupStr(char *str);
  106. #define FreeStr(s) FreeVec(s)
  107.  
  108.  
  109. #endif /* HOTKEY_TYPES_H */
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.